﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WMS.IDAL;
using System.Data.SQLite;
using System.Data;
using WMS.DAL.DBUtility;

namespace WMS.DAL.SQLite
{
    public class ErrorInfoDB:IErrorInfo
    {
        private readonly string sqlAddString = "insert into errorinfo(title,message) values(@title,@message)";

        #region IErrorInfo 成员

        public int Add(WMS.Entity.ErrorInfoEntity entity)
        {
            SQLiteParameter[] para = new SQLiteParameter[]
            {
                new SQLiteParameter("@title",DbType.String),
                new SQLiteParameter("@message",DbType.String)
            };
            para[0].Value = entity.Title;
            para[1].Value = entity.Message;

            return SQLiteHelper.ExecuteNonQuery(sqlAddString,para) ;
        }

        #endregion
    }
}
